package com.lly.songhigh.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lly.songhigh.R;
import com.lly.songhigh.adapter.SearchResultActivityAdapter;

/**
 * Created by 李海龙 on 15/10/27.
 */
public class SearchResultFragment extends BaseFragment {

//
//    @Bind(R.id.search_result_tabLayout)
//    TabLayout searchResultTabLayout;
//    @Bind(R.id.search_result_viewPager)
//    ViewPager searchResultViewPager;
    private TabLayout searchResultTabLayout;
    private ViewPager searchResultViewPager;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_search_result, null);
        searchResultTabLayout = (TabLayout) view.findViewById(R.id.search_result_tabLayout);
        searchResultTabLayout.setSelectedTabIndicatorColor(0xFFc03c35);
        searchResultViewPager = (ViewPager) view.findViewById(R.id.search_result_viewPager);
        initView();
        return view;

    }

    private void initView() {
        SearchResultActivityAdapter adapter = new SearchResultActivityAdapter
                (getActivity().getSupportFragmentManager());
        searchResultViewPager.setAdapter(adapter);
        searchResultTabLayout.setupWithViewPager(searchResultViewPager);
    }
    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }
}
